<div class="middle surface-shaded">
  <div class="middle-content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-10">
          <breadcrumbs breadcrumbs="breadcrumbs"></breadcrumbs>
          <div ng-show="!containers.length">Loading...</div>
          <form ng-if="containers.length" name="form" class="set-limits-form" novalidate>
            <h1>Resource Limits: {{name}}</h1>
            <div class="help-block">
              Resource limits control how much <span ng-if="!hideCPU">CPU and</span> memory a container will consume on a node.
              <div class="learn-more-block" ng-class="{ 'gutter-bottom': showPodWarning }">
                <a href="{{'compute_resources' | helpLink}}" target="_blank">Learn More <i class="fa fa-external-link" aria-hidden="true"></i></a>
              </div>
            </div>
            <div ng-if="showPodWarning" class="alert alert-warning">
              <span class="pficon pficon-warning-triangle-o" aria-hidden="true"></span>
              Changes will only apply to new pods.
            </div>
            <fieldset ng-disabled="disableInputs">
              <div ng-repeat="container in containers"
                   ng-init="formName = container.name + '-form'">
                <h2 ng-if="containers.length > 1">Container {{container.name}}</h2>
                <edit-request-limit
                    resources="container.resources"
                    type="cpu"
                    limit-ranges="limitRanges"
                    project="project">
                </edit-request-limit>
                <edit-request-limit
                    resources="container.resources"
                    type="memory"
                    limit-ranges="limitRanges"
                    project="project">
                </edit-request-limit>
              </div>
              <div ng-repeat="problem in cpuProblems" class="has-error">
                <span class="help-block">{{problem}}</span>
              </div>
              <div ng-repeat="problem in memoryProblems" class="has-error">
                <span class="help-block">{{problem}}</span>
              </div>

              <pause-rollouts-checkbox
                  ng-if="object | managesRollouts"
                  deployment="object">
              </pause-rollouts-checkbox>

              <div class="button-group gutter-top gutter-bottom">
                <button type="submit"
                  class="btn btn-primary btn-lg"
                  ng-click="save()"
                  ng-disabled="form.$pristine || form.$invalid || disableInputs || cpuProblems.length || memoryProblems.length"
                  value="">Save</button>
                <button class="btn btn-default btn-lg" ng-click="cancel()">Cancel</button>
              </div>
            </fieldset>
          </form>
        </div>
      </div>
    </div>
  </div><!-- /middle-content -->
</div><!-- /middle -->
